package exception;

import Homework0816.IllegalException;

import java.util.Arrays;

public class Person {
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) throws IllegalException{
        if(age<0||age>120)
        {
            //throw new RuntimeException("illegal age");
            throw new IllegalException("illegal age");
        }
        this.age = age;
    }
}
